Skip to main content
Version: V3.0

Authorization API


Client Credentials Grant - Get Access Token

Request URL

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/x-www-form-urlencoded
AcceptStringHeaderYesAccept, the value is application/json
grant_typeStringBodyYesGrant type, the value is client_credentials
client_idStringBodyYesClient ID
client_secretStringBodyYesClient secret
expires_inIntegerBodyNoToken expiration time (s)

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
access_tokenStringBodyAccess token
token_typeStringBodyToken type, the value is bearer
expires_inIntegerBodyToken expiration time (s)

Request Example

POST /api/v1.0/invoke/open-ability/method/oauth2/token

Content-Type: application/x-www-form-urlencoded

Accept: application/json

grant_type=client_credentials&

client_id=caa0b4dffd57202a157bf46664f93c192&

client_secret=s75b058bfd9e4e0659d75b67a03334745

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {
"access_token": "a9be2f2a080979547f430ffc3e81ba47d",
"token_type": "bearer",
"expires_in": 3600
}
}

Failure Return Example

See Failure Return Example